/* NOTICE
 
    Jim - the Java Image Manager, copyright (c) 2005 - 2007 Grant Gardner 
 
    Jim is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Jim is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
    In addition, as a special exception, you are permitted to link this code
    with the 3rd party libraries required to compile this file and to
    distribute a linked combination including them. You must obey the
    GNU General Public License in all respects for all of the code except for
    those 3rd party libraries that are licenced under terms incompatible with the
    GNU General Public License.  
 
 
 NOTICE */

/*
 * Created by dnoakes on 27-Nov-2002 10:10:47 using IntelliJ IDEA.
 */

package au.com.lastweekend.jim.io.exif.makernote.minolta;

import java.util.HashMap;
import java.util.Map;

import au.com.lastweekend.jim.io.metadata.Directory;

/**
 * 
 * 
 * 
 * @version $Id: MinoltaMakernoteDirectory.java,v 1.3 2006/02/20 12:21:10 ggardner Exp $
 * @author <a href="mailto:grant@lastweekend.com.au"> <Grant Gardner> </a>
 */
public class MinoltaMakernoteDirectory extends Directory {

    public static final int TAG_MINOLTA_VERSION = 0x0000;
    public static final int TAG_MINOLTA_SETTINGS_1 = 0x0001;
    public static final int TAG_MINOLTA_SETTINGS_2 = 0x0003;
    public static final int TAG_MINOLTA_UNKNOWN_0010 = 0x0010;
    public static final int TAG_MINOLTA_UNKNOWN_0020 = 0x0020;

    // Old Thumbnail tags
    public static final int TAG_MINOLTA_COMPRESSED_IMAGE_SIZE = 0x0040;
    public static final int TAG_THUMBNAIL = 0x0081;

    // New thumbnail offset tags

    public static final int TAG_MINOLTA_THUMBNAIL_OFFSET = 0x0088;
    public static final int TAG_MINOLTA_THUMBNAIL_LENGTH = 0x0089;

    public static final int TAG_MINOLTA_UNKNOWN_0100 = 0x0100;

    public static final int TAG_MINOLTA_COLOUR_MODE = 0x0101;
    public static final int TAG_MINOLTA_IMAGE_QUALITY_1 = 0x0102;
    public static final int TAG_MINOLTA_IMAGE_QUALITY_2 = 0x0103;

    public static final int TAG_MINOLTA_PIM = 0x0e00;

    public static final int TAG_MINOLTA_UNKNOWN_0F00 = 0x0F00;

    protected static final HashMap<Integer, String> TAG_NAME_MAP = new HashMap<Integer, String>();

    static {
        TAG_NAME_MAP.put(TAG_MINOLTA_VERSION, "Version");
        TAG_NAME_MAP.put(TAG_MINOLTA_SETTINGS_1, "Camera Settings");
        TAG_NAME_MAP.put(TAG_MINOLTA_SETTINGS_2, "Camera Settings");
        TAG_NAME_MAP.put(TAG_MINOLTA_UNKNOWN_0010, "Undecoded 0x0100");
        TAG_NAME_MAP.put(TAG_MINOLTA_UNKNOWN_0020, "Undecoded 0x0020");

        // Old Thumbnail tags
        TAG_NAME_MAP.put(TAG_MINOLTA_COMPRESSED_IMAGE_SIZE, "Image Size");
        TAG_NAME_MAP.put(TAG_THUMBNAIL, "Thumbnail Data");

        // New thumbnail offset tags

        TAG_NAME_MAP.put(TAG_MINOLTA_THUMBNAIL_OFFSET, "Thumbnail Offset");
        TAG_NAME_MAP.put(TAG_MINOLTA_THUMBNAIL_LENGTH, "Thumbnail Length");

        TAG_NAME_MAP.put(TAG_MINOLTA_UNKNOWN_0100, "Undecoded 0x0100");

        TAG_NAME_MAP.put(TAG_MINOLTA_COLOUR_MODE, "Colour Mode");
        TAG_NAME_MAP.put(TAG_MINOLTA_IMAGE_QUALITY_1, "Image Quality");
        TAG_NAME_MAP.put(TAG_MINOLTA_IMAGE_QUALITY_2, "Image Quality");

        TAG_NAME_MAP.put(TAG_MINOLTA_PIM, "Print Image Matching Info");

        TAG_NAME_MAP.put(TAG_MINOLTA_UNKNOWN_0F00, "Undecoded 0x0F00");

    }

    public MinoltaMakernoteDirectory(Directory parent) {

        super(parent);
        this.setDescriptor(new MinoltaMakernoteDescriptor(this));
    }

    @Override
    public String getName() {

        return "Minolta Makernote";
    }

    @Override
    protected Map<Integer, String> getTagNameMap() {

        return TAG_NAME_MAP;
    }
}